package com.automannn.springPractice.zStudy.lifecycle;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author weave
 * @since 2024-06-27 10:16
 */
@Configuration
public class BeansConfig {

    @Bean(name = "user", initMethod = "doInit", destroyMethod = "doDestroy")
    public User create() {
        User user = new User();
        user.setName("weave");
        user.setAge(26);
        return user;
    }
}
